bpo-43680: _pyio.open() becomes a static method#25354
Merged
vstinner merged 3 commits intopython:masterfrom Apr 12, 2021
vstinner:pyio_openwrapper
Merged
bpo-43680: _pyio.open() becomes a static method#25354vstinner merged 3 commits intopython:masterfrom vstinner:pyio_openwrapper
vstinner merged 3 commits intopython:masterfrom
vstinner:pyio_openwrapper
Conversation
The Python _pyio.open() function becomes a static method to behave as io.open() built-in function: don't become a bound method when stored as a class variable. It becomes possible since static methods are now callable in Python 3.10. Moreover, _pyio.OpenWrapper becomes a simple alias to _pyio.open. init_set_builtins_open() now sets builtins.open to io.open, rather than setting it to io.OpenWrapper, since OpenWrapper is now an alias to open in the io and _pyio modules.
Member
Author
|
@methane: Would you mind to review this change? Thanks to https://bugs.python.org/issue43682, it becomes possible to put |
methane
reviewed
Apr 12, 2021
Misc/NEWS.d/next/Library/2021-04-12-09-57-37.bpo-43680.o1zEk_.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Member
|
Can we remove It is not defined in C _io module. So I think it is safe to remove. |
Member
Author
Sure, it was not documented and doesn't exist in the io module. I already removed it: 3bc694d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Python _pyio.open() function becomes a static method to behave as
io.open() built-in function: don't become a bound method when stored
as a class variable. It becomes possible since static methods are now
callable in Python 3.10. Moreover, _pyio.OpenWrapper becomes a simple
alias to _pyio.open.
init_set_builtins_open() now sets builtins.open to io.open, rather
than setting it to io.OpenWrapper, since OpenWrapper is now an alias
to open in the io and _pyio modules.
https://bugs.python.org/issue43680